#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fast cin.tie(0) , cin.sync_with_stdio(0)
#define clr(arr,val) memset((arr),(val),sizeof(arr))
#define oset(x) tree<x, null_type,less_equal<x>, rb_tree_tag,tree_order_statistics_node_update> //less_equal
#define endl "\n"
#define read(arr , n) for(int i=0;i<n;i++)cin>>arr[i];
#define ll long long
#define pb push_back
#define pp pop_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define vl vector<ll>
#define vll vector<pair<ll,ll>>
#define vvl vector<vl>
#define pll pair<ll,ll>
#define f first
#define s second
#define MOD 1000000007
#define mul(x , y , m) ((x%m) * (y%m))%m
const double PI = 2*acos(0.0);
const ll INF = (ll)1e15;
const ll N = (ll)1e5 + 5, M = (ll)1e3;
ll dx[] = {0 , 1 , 0 , -1};
ll dy[] = {1 , 0 , -1 , 0};
ll dxx[] = {-1 ,-1 , 0 , 1 , 1 , 1 , 0 , -1};
ll dyy[] = { 0 , 1 , 1 , 1 , 0 ,-1 ,-1 , -1};
void solve(int tt )
{
ll n,k; cin>>n>>k;
map<ll , ll>mp;
for(int i=0 ; i<n ; i++)
{
ll x; cin>>x;
mp[x]++;
}
ll sum = 0;
for(auto i : mp)sum += i.s;
for(auto & it : mp)
{
if(k <= it.s * sum)
{
cout<<it.f<<" ";
for(auto jt : mp)
{
if(k <= jt.s * it.s)return void(cout<<jt.f);
k -= jt.s * it.s;
}
}
k -= sum * it.s;
}
}
int main()
{
fast;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int t = 1 , tt = 0;
//cin>>t;
while(t--)solve(++tt);
return 0;
}
445. Add Two Numbers II | 442. Find All Duplicates in an Array |
437. Path Sum III | 436. Find Right Interval |
435. Non-overlapping Intervals | 406. Queue Reconstruction by Height |
380. Insert Delete GetRandom O(1) | 332. Reconstruct Itinerary |
368. Largest Divisible Subset | 377. Combination Sum IV |
322. Coin Change | 307. Range Sum Query - Mutable |
287. Find the Duplicate Number | 279. Perfect Squares |
275. H-Index II | 274. H-Index |
260. Single Number III | 240. Search a 2D Matrix II |
238. Product of Array Except Self | 229. Majority Element II |
222. Count Complete Tree Nodes | 215. Kth Largest Element in an Array |
198. House Robber | 153. Find Minimum in Rotated Sorted Array |
150. Evaluate Reverse Polish Notation | 144. Binary Tree Preorder Traversal |
137. Single Number II | 130. Surrounded Regions |
129. Sum Root to Leaf Numbers | 120. Triangle |